#pragma once

class MainSystem
{
	bool mbInitialized;
	bool mbExit;
	SmartPtr <HGE_Impl>					m_pHGESystem;		// The HGE System, contains directX device
	SmartPtr <hgeResourceManager>		m_pResources;		// Reads Resource Scripts and Handles resources

	SmartPtr <hgeTTF :: FontManager>	m_pFontManager;		// Font Manager that Manages TrueTypeFonts (only some specific ones only though)
public:
	MainSystem();
	~MainSystem();

	bool Initialize();
	bool ShutDown();

	inline	HGE_Impl *				HGESYSTEM() const	{ return m_pHGESystem.get(); }
	inline	hgeResourceManager *	RESOURCE()			{ return m_pResources.get(); }
	inline	hgeTTF :: FontManager * FONT_MANAGER()		{ return m_pFontManager.get(); }

	static	bool ExitFrame();
	static	bool UpdateFrame();
	static	bool RenderFrame();
};

extern SmartPtr <MainSystem> g_pSystem_Main;


#define KeyDown(keyValue)	g_pSystem_Main->HGESYSTEM()->Input_GetKeyState(keyValue)
#define KeyUp(keyValue)		!g_pSystem_Main->HGESYSTEM()->Input_GetKeyState(keyValue)

#define KeyPressed(keyValue)	g_pSystem_Main->HGESYSTEM()->Input_KeyDown(keyValue)
#define KeyReleased(keyValue)	g_pSystem_Main->HGESYSTEM()->Input_KeyUp(keyValue)